package team.szm.scd.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.stereotype.Service;
import team.szm.scd.database.entity.Medicine;
import team.szm.scd.database.mapper.MedicineMapper;
import team.szm.scd.database.vo.MedicineVO;
import team.szm.scd.service.interfaces.IMedicineService;

import javax.annotation.Resource;
import java.util.List;

@Service
public class MedicineServiceImpl implements IMedicineService {
    @Resource
    MedicineMapper mapper;

    @Override
    public List<Medicine> searchMedicine(String name) {
        QueryWrapper<Medicine> queryWrapper = new QueryWrapper<>();
        queryWrapper.like("mname", name);
        return mapper.selectList(queryWrapper);
    }

    @Override
    public List<MedicineVO> fromCaseId(String caseId) {
        return mapper.fromCaseId(caseId);
    }
}
